/*
 * @Description: 次项目的路由表，涉及到的跳转都在这里
 * @Author: yingying.fan
 * @Date: 2019-05-23 16:51:01
 * @Last Modified by: buwei.huang
 * @Last Modified time: 2019-06-11 17:32:49
 */
import { open } from './JumpUtils'

function goToPage(url, params) {
  if (params) {
    if (url.indexOf('?') > 0) {
      // url包含?则后面添加&
      url += '&'
    } else {
      url += '?'
    }
    url += params
  }
  open(url)
}

// 时刻表页面
function goToTimeTable(params = null) {
  let url = 'bus-app/timeTable.html?_tv=true'
  goToPage(url, params)
}

// 纠错页面
function goToCorrection(params = null) {
  let url = 'bus-app/correction.html?_knbw=true'
  goToPage(url, params)
}

// 同站线路页面
function goToSiteDetails(params = null) {
  let url = 'bus-app/siteDetails.html'
  goToPage(url, params)
}

// 云卡页面
function goToCloudCard(params = null) {
  let url = 'buscard-app/cardinfo.html?_tv=true'
  goToPage(url, params)
}

// 公告详情
function goToNoticeDetail(params = null) {
  let url = 'city-app/linenoticedetail.html'
  goToPage(url, params)
}

// 公交线路
function goToLine(params = null) {
  let url = 'Line.html?_tv=false'
  goToPage(url, params)
}

// 搜公交
function goToSearchCar(params = null) {
  let url = 'SearchCar.html?_tv=false'
  goToPage(url, params)
}

// 站点下线路
function goToStationDetails(params = null) {
  // let url = 'bus-app/StationDetails.html?_tv=false'
  let url = 'StationDetails.html?_tv=false'
  goToPage(url, params)
}

// 站点下线路跳转 去这里
function goToHere(params = null) {
  let url = 'routePlan.html'
  goToPage(url, params)
}

export {
  open,
  goToTimeTable,
  goToCorrection,
  goToSiteDetails,
  goToCloudCard,
  goToNoticeDetail,
  goToSearchCar,
  goToStationDetails,
  goToHere,
  goToLine
}
